This repository was archived by the owner on Feb 24, 2026. It is now read-only.
Improve hmr development experience#617
Closed
libondev wants to merge 4 commits intoposva:mainfrom
Closed
Conversation
… `createRouter` NOTE: `handleHotUpdate` parameter is valid only when createRouter exported in `vue-router/auto-routes` is used.
posva
suggested changes
Apr 22, 2025
Owner
posva
left a comment
There was a problem hiding this comment.
It could be great to automatically add the HMR code but createRouter must be imported from vue-router for everything to work well. Maybe a solution is to automatically add the HMR code like in vuejs/pinia#2954
Author
|
It would be more appropriate to let the plug-in do the job, Maybe I should go through the ast to find the CreateOutter and inject this hmr code? |
Owner
|
I would really go with a version similar to vuejs/pinia#2954 and keep changes to the minimum |
Author
I see. I'll try it. |
Author
|
The new implementation is here, so close this pr. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This plugin has been used in many of my projects and feels good, but the only problem is that I need to manually manage my hmr (import.meta.hot). This pr converts this operation to internal processing and provides a new
createRoutermethod inside thevue-router/auto-routesmodule to simplify the problem of developers needing to manually manage hmr (internal processing occurs inside this function).I don't know if this change is reasonable. I hope to get your correction opinion, because you are a professional in this regard. : )